#ifndef I2C_DEVICE_H
#define I2C_DEVICE_H 1

#include <linux/types.h>

class I2CDevice
{
  public:
    I2CDevice(int file, __u8 address);
    virtual ~I2CDevice();

  protected:
    // returns the status. -1 on error 
    __s32 writeByte(__u8 reg, __u8 val);

    // return the read value. -1 on error 
    __s32 readByte(__u8 reg);

    // returns number blocks read
    __s32 readBlock(__u8 reg, __u8 * buf, int size);

    
  private: 
    void acquireSlave();
    __u8 m_address;
    int  m_file;

};


#endif
